home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / comal #3 < prev    next >
Text File  |  2022-08-26  |  4KB  |  239 lines

  1.  
  2. COMAL corner-Part 3    by Jimmy Weiler
  3.  
  4.    THE COMAL 0.14 OPERATING SYSTEM
  5.  
  6.  - - - - - - - - - - - - - - - - - -
  7. PART THE FIRST: JUST ENOUGH TO GET BY
  8.  - - - - - - - - - - - - - - - - - -
  9.  
  10. Command: 'PASS'
  11.  
  12.   Since you're going to want to save
  13.  
  14. everything you write, you're going to
  15.  
  16. need to know how COMAL handles disk
  17.  
  18. commands.
  19.  
  20.   First, you need to format a disk.
  21.  
  22. We all remember the DOS NEW command:
  23.  
  24. OPEN15,8,15,"N0:MY DISK NAME,ID". In
  25.  
  26. COMAL when we pass a command to the
  27.  
  28. disk we don't need to open a channel.
  29.  
  30. We just use the "PASS" command:
  31.  
  32. PASS "N0:MY DISK NAME,ID"
  33.  
  34.   There is NO difference between disks
  35.  
  36. formatted with the BASIC command or
  37.  
  38. the COMAL command.  You can store both
  39.  
  40. COMAL and BASIC programs on the same
  41.  
  42. disk.  Both types will appear as PRG
  43.  
  44. files, so be consistent with naming
  45.  
  46. conventions if you are going to mix
  47.  
  48. languages on one disk.  Tacking ".C"
  49.  
  50. to the end of every COMAL 0.14 program
  51.  
  52. name is sufficient.
  53.  
  54.   Any DOS command that you could use
  55.  
  56. in an OPEN statement in BASIC can be
  57.  
  58. PASSed by COMAL.  The commands include
  59.  
  60. NEW             "N0:NAME,ID"
  61. RENAME          "R0:NEWNAME=OLDNAME"
  62. SCRATCH         "S0:FILENAME"
  63. COPY            "C0:NEWFILE=0:OLDFILE"
  64. VALIDATE        "V0"
  65. INITIALIZE      "I0"
  66.  
  67.  - - - - - - - - - - - - - - - - - -
  68.  
  69. Command: 'CAT'
  70.  
  71.   You want to be able to see what
  72.  
  73. programs are on your COMAL disk.  In
  74.  
  75. BASIC, you LOAD"$",8 and LIST it.  In
  76.  
  77. COMAL, you look at the catalog (or
  78.  
  79. directory) with the CAT command.  It
  80.  
  81. works much like the @$ command that
  82.  
  83. comes with the DOS wedge. (If you
  84.  
  85. don't know about the wedge, I suggest
  86.  
  87. you check out DOS & DON'TS -- we
  88.  
  89. covered the wedge in the first
  90.  
  91. installments of that series.)
  92.  
  93. Example:
  94.  
  95.  CAT
  96.  
  97. 0"MY DISK NAME" C1 2A
  98. 660 BLOCKS FREE
  99.  
  100.  - - - - - - - - - - - - - - - - - -
  101.  
  102. Command: 'STATUS$'
  103.  
  104.   When the red light is flashing on
  105.  
  106. your 1541 disk drive, that means you
  107.  
  108. had a disk error.  BASIC provides no
  109.  
  110. easy way to find out what the error
  111.  
  112. was.  COMAL, on the other hand, has
  113.  
  114. the STATUS$ command.  At any time, you
  115.  
  116. can type STATUS$ and the disk error
  117.  
  118. status will be revealed.  If the red
  119.  
  120. light was not flashing, the status
  121.  
  122. will usually be OK.  STATUS$ is
  123.  
  124. equivalent to the DOS wedge @ command.
  125.  
  126.  - - - - - - - - - - - - - - - - - -
  127.  
  128. 'PROGRAM ENTRY'
  129.  
  130.   Writing a program in COMAL is much
  131.  
  132. like writing one in BASIC.  Enter the
  133.  
  134. line number followed by the
  135.  
  136. instruction.  Then press RETURN.  Line
  137.  
  138. numbers cannot exceed 9999.
  139.  
  140. 100 PRINT "HELLO"
  141. 200 PRINT "I AM COMAL"
  142.  
  143. If you enter something wrong, COMAL
  144.  
  145. will reject your line and place the
  146.  
  147. cursor at the first error in the line.
  148.  
  149.  - - - - - - - - - - - - - - - - - -
  150.  
  151. Command: 'LIST'
  152.  
  153.   To view a COMAL program, you type
  154.  
  155. LIST.  You can view any line or group
  156.  
  157. of lines.
  158.  
  159. LIST      -- prints the whole program.
  160. LIST 100  -- prints just line 100.
  161. LIST 5,80 -- prints all lines from 5
  162.              through line 80.
  163.  
  164.  - - - - - - - - - - - - - - - - - -
  165.  
  166. 'PROGRAM EDITING'
  167.  
  168.   Editing in COMAL works almost like
  169.  
  170. it does in BASIC.  You can either
  171.  
  172. re-type the entire program line, or
  173.  
  174. you can list it and use the CRSR keys
  175.  
  176. and INST/DEL to edit the line on the
  177.  
  178. screen.  You enter a line by pressing
  179.  
  180. RETURN.  As usual for the Commodore
  181.  
  182. 64, if the cursor is ANYWHERE on the
  183.  
  184. line, the whole line will be accepted.
  185.  
  186.  - - - - - - - - - - - - - - - - - -
  187.  
  188. Command: 'RUN'
  189.  
  190.   You can run your program in memory
  191.  
  192. at any time by entering RUN.
  193.  
  194.  - - - - - - - - - - - - - - - - - -
  195.  
  196. Command: 'SAVE'
  197.  
  198.   Save the program to disk with the
  199.  
  200. SAVE command.  Unlike BASIC, COMAL
  201.  
  202. does not use a unit number, so
  203.  
  204. SAVE "MY PROGRAM",8 (BASIC syntax)
  205.  
  206.   becomes
  207.  
  208. SAVE "MY PROGRAM"  (COMAL syntax).
  209.  
  210.  - - - - - - - - - - - - - - - - - -
  211.  
  212. Command: 'NEW'
  213.  
  214.   NEW erases your program from memory,
  215.  
  216. just like in BASIC.
  217.  
  218.  - - - - - - - - - - - - - - - - - -
  219.  
  220. Command: 'LOAD'
  221.  
  222.   You reload your program from the
  223.  
  224. disk with the LOAD command.
  225.  
  226.   Like SAVE, LOAD does not use a unit
  227.  
  228. number.
  229.  
  230.   LOAD "MY PROGRAM" will load the
  231.  
  232. program we just told you how to SAVE.
  233.  
  234.   After you load a program, you get it
  235.  
  236. started by typing RUN.
  237.  
  238.  - - - - - - - - - - - - - - - - - -
  239.